/*
 * Turnos.java
 *
 * Created on 10 de junio de 2008, 18:51
 */
package podologia;

import podologia.util.Rep;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.PersistenceUnit;
import javax.persistence.Query;
import javax.swing.JOptionPane;
import podologia.beans.InfoHora;
import podologia.beansDB.Diaatencion;
import podologia.beansDB.Empleado;
import podologia.beansDB.Lugaratencion;
import podologia.beansDB.Paciente;
import podologia.beansDB.Practica;
import podologia.beansDB.Practicaxempleado;
import podologia.beansDB.Turno;

/**
 *
 * @author  Hernán
 */
public class Turnos extends javax.swing.JInternalFrame {

    /** Creates new form Turnos */
    private InfoHora[] hora = new InfoHora[61];
    private InfoHora[] duracion = new InfoHora[12];
    private long[] dur = new long[61];
    private String prestacion;
    private List<Diaatencion> diaatencion = new ArrayList<Diaatencion>();
    private List<Turno> turnos = new ArrayList<Turno>();
    private int[] indices = new int[61];
    @PersistenceUnit(unitName = "PodologiaPU")
    private EntityManagerFactory emf = Persistence.createEntityManagerFactory("PodologiaPU");
    private Calendario calendario = new Calendario();
    private Boolean sobreturno=false;
    private long max;
    private long min;

    private void CargarCalendario() {
        calendario.cargarData(turnos,diaatencion);
        calendario.updateUI();
        calendario.repaint();
    }

    private EntityManager getEntityManager() {
        return emf.createEntityManager();
    }

    public Turnos() {
        initComponents();
        // initComboHora();
        // Horario test = new Horario();
        // System.out.print(test.getHorario(1).toString());
        //jSPCalendario.setViewportView(calendario);
        calendario.setBounds(0, 0, 700, 480);
        jPCalendario.add(calendario);        
        jComboBoxPrestacion.setSelectedIndex(-1);
        jComboBoxProfesional.setSelectedIndex(-1);
        jComboBoxDuracion.setSelectedIndex(-1);
        jComboBoxHorarioTurno.setSelectedIndex(-1);
        evento();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        PodologiaPUEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("PodologiaPU").createEntityManager();
        practicaQuery = java.beans.Beans.isDesignTime() ? null : PodologiaPUEntityManager.createQuery("SELECT p FROM Practica p");
        practicaList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : practicaQuery.getResultList();
        empleadoQuery = java.beans.Beans.isDesignTime() ? null : PodologiaPUEntityManager.createQuery("SELECT e FROM Empleado e");
        empleadoList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : empleadoQuery.getResultList();
        practicaxempleadoQuery = java.beans.Beans.isDesignTime() ? null : PodologiaPUEntityManager.createQuery("SELECT p FROM Practicaxempleado p");
        practicaxempleadoList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : practicaxempleadoQuery.getResultList();
        pacienteQuery = java.beans.Beans.isDesignTime() ? null : PodologiaPUEntityManager.createQuery("SELECT p FROM Paciente p");
        pacienteList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : pacienteQuery.getResultList();
        pacienteQuery1 = java.beans.Beans.isDesignTime() ? null : PodologiaPUEntityManager.createQuery("SELECT p FROM Paciente p");
        pacienteList1 = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : pacienteQuery1.getResultList();
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(podologia.PodologiaApp.class).getContext().getResourceMap(Turnos.class);
        turnosQuery = java.beans.Beans.isDesignTime() ? null : PodologiaPUEntityManager.createQuery(resourceMap.getString("turnosQuery.query")); // NOI18N
        jLabel3 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jComboBoxPrestacion = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        jComboBoxProfesional = new javax.swing.JComboBox();
        jPanel2 = new javax.swing.JPanel();
        jCalendar1 = new org.freixas.jcalendar.JCalendar();
        jLabel14 = new javax.swing.JLabel();
        jComboBoxHorarioTurno = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        jComboBoxDuracion = new javax.swing.JComboBox();
        jLabel15 = new javax.swing.JLabel();
        jComboBoxLugar = new javax.swing.JComboBox();
        jLabel11 = new javax.swing.JLabel();
        jButtonReservar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTablePaciente = new javax.swing.JTable();
        jTextFieldPaciente = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jToggleButton1 = new javax.swing.JToggleButton();
        jButton2 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jLabel37 = new javax.swing.JLabel();
        jSPCalendario = new javax.swing.JScrollPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jPCalendario = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabel31 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();

        setClosable(true);
        setMaximizable(true);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setAutoscrolls(true);
        setName("Form"); // NOI18N

        jLabel3.setName("jLabel3"); // NOI18N

        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setName("jLabel2"); // NOI18N

        jLabel5.setName("jLabel5"); // NOI18N

        jLabel4.setName("jLabel4"); // NOI18N

        jLabel6.setName("jLabel6"); // NOI18N

        jLabel7.setName("jLabel7"); // NOI18N

        jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
        jButton3.setName("jButton3"); // NOI18N

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel3.setName("jPanel3"); // NOI18N

        jLabel10.setFont(resourceMap.getFont("jLabel10.font")); // NOI18N
        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jComboBoxPrestacion.setName("jComboBoxPrestacion"); // NOI18N

        org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, practicaList, jComboBoxPrestacion);
        bindingGroup.addBinding(jComboBoxBinding);

        jComboBoxPrestacion.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jComboBoxPrestacionItemStateChanged(evt);
            }
        });

        jLabel9.setFont(resourceMap.getFont("jLabel9.font")); // NOI18N
        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jComboBoxProfesional.setName("jComboBoxProfesional"); // NOI18N

        jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, practicaxempleadoList, jComboBoxProfesional);
        bindingGroup.addBinding(jComboBoxBinding);

        jComboBoxProfesional.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
                jComboBoxProfesionalPopupMenuWillBecomeInvisible(evt);
            }
            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
            }
        });
        jComboBoxProfesional.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jComboBoxProfesionalItemStateChanged(evt);
            }
        });

        jPanel2.setBackground(resourceMap.getColor("jPanel2.background")); // NOI18N
        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setName("jPanel2"); // NOI18N

        jCalendar1.setBackground(resourceMap.getColor("jCalendar1.background")); // NOI18N
        jCalendar1.setName("jCalendar1"); // NOI18N
        jCalendar1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jCalendar1MouseClicked(evt);
            }
        });
        jCalendar1.addDateListener(new org.freixas.jcalendar.DateListener() {
            public void dateChanged(org.freixas.jcalendar.DateEvent evt) {
                jCalendar1DateChanged(evt);
            }
        });
        jCalendar1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jCalendar1PropertyChange(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 315, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(78, 78, 78))
        );

        jLabel14.setFont(resourceMap.getFont("jLabel14.font")); // NOI18N
        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        jComboBoxHorarioTurno.setName("jComboBoxHorarioTurno"); // NOI18N

        jLabel13.setFont(resourceMap.getFont("jLabel13.font")); // NOI18N
        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        jComboBoxDuracion.setName("jComboBoxDuracion"); // NOI18N

        jLabel15.setFont(resourceMap.getFont("jLabel15.font")); // NOI18N
        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jComboBoxLugar.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Consultorio", "Domicilio" }));
        jComboBoxLugar.setName("jComboBoxLugar"); // NOI18N

        jLabel11.setFont(resourceMap.getFont("jLabel11.font")); // NOI18N
        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jButtonReservar.setText(resourceMap.getString("jButtonReservar.text")); // NOI18N
        jButtonReservar.setName("jButtonReservar"); // NOI18N
        jButtonReservar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonReservarActionPerformed(evt);
            }
        });

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTablePaciente.setName("jTablePaciente"); // NOI18N

        org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, pacienteList, jTablePaciente);
        org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${idPersona.apellido}"));
        columnBinding.setColumnName("Apellido");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${idPersona.nombre}"));
        columnBinding.setColumnName("Nombre");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${idPersona.nroDoc}"));
        columnBinding.setColumnName("Num. doc.");
        columnBinding.setColumnClass(Double.class);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jTablePaciente.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTablePacienteMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTablePaciente);

        jTextFieldPaciente.setText(resourceMap.getString("jTextFieldPaciente.text")); // NOI18N
        jTextFieldPaciente.setName("jTextFieldPaciente"); // NOI18N
        jTextFieldPaciente.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldPacienteKeyReleased(evt);
            }
        });

        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jToggleButton1.setFont(resourceMap.getFont("jToggleButton1.font")); // NOI18N
        jToggleButton1.setText(resourceMap.getString("jToggleButton1.text")); // NOI18N
        jToggleButton1.setName("jToggleButton1"); // NOI18N
        jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton1ActionPerformed(evt);
            }
        });

        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
        jButton2.setName("jButton2"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
        jButton4.setName("jButton4"); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jLabel37.setFont(resourceMap.getFont("jLabelMensaje.font")); // NOI18N
        jLabel37.setForeground(resourceMap.getColor("jLabelMensaje.foreground")); // NOI18N
        jLabel37.setText(resourceMap.getString("jLabelMensaje.text")); // NOI18N
        jLabel37.setName("jLabelMensaje"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel13)
                    .addComponent(jLabel14)
                    .addComponent(jLabel15)
                    .addComponent(jLabel11)
                    .addComponent(jLabel9)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 494, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButtonReservar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jToggleButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jComboBoxHorarioTurno, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jComboBoxDuracion, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jComboBoxLugar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGap(149, 149, 149))
                                                    .addComponent(jComboBoxProfesional, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                    .addComponent(jLabel37, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 247, Short.MAX_VALUE))
                                                .addGap(60, 60, 60))
                                            .addComponent(jComboBoxPrestacion, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                        .addComponent(jTextFieldPaciente, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(1, 1, 1)))
                                .addComponent(jButton2)
                                .addGap(232, 232, 232)))
                        .addContainerGap())))
        );

        jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jComboBoxDuracion, jComboBoxHorarioTurno, jComboBoxLugar});

        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jComboBoxPrestacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(jComboBoxProfesional, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(2, 2, 2)
                        .addComponent(jLabel37)
                        .addGap(3, 3, 3)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(jComboBoxHorarioTurno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel13)
                            .addComponent(jComboBoxDuracion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel15)
                            .addComponent(jComboBoxLugar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jTextFieldPaciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jToggleButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonReservar, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton4))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jSPCalendario.setName("jSPCalendario"); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        jPanel4.setName("jPanel4"); // NOI18N

        jLabel8.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jLabel12.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        jLabel16.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        jLabel17.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jLabel18.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        jLabel19.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        jLabel20.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        jLabel21.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        jLabel22.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
        jLabel22.setName("jLabel22"); // NOI18N

        jLabel23.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
        jLabel23.setName("jLabel23"); // NOI18N

        jLabel24.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
        jLabel24.setName("jLabel24"); // NOI18N

        jLabel25.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel25.setText(resourceMap.getString("jLabel25.text")); // NOI18N
        jLabel25.setName("jLabel25"); // NOI18N

        jLabel26.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
        jLabel26.setName("jLabel26"); // NOI18N

        jLabel27.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel27.setText(resourceMap.getString("jLabel27.text")); // NOI18N
        jLabel27.setName("jLabel27"); // NOI18N

        jLabel28.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel28.setText(resourceMap.getString("jLabel28.text")); // NOI18N
        jLabel28.setName("jLabel28"); // NOI18N

        jLabel29.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel29.setText(resourceMap.getString("jLabel29.text")); // NOI18N
        jLabel29.setName("jLabel29"); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel25)
                    .addComponent(jLabel23)
                    .addComponent(jLabel20)
                    .addComponent(jLabel18)
                    .addComponent(jLabel12)
                    .addComponent(jLabel16)
                    .addComponent(jLabel17)
                    .addComponent(jLabel19)
                    .addComponent(jLabel21)
                    .addComponent(jLabel22)
                    .addComponent(jLabel24)
                    .addComponent(jLabel26)
                    .addComponent(jLabel27)
                    .addComponent(jLabel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel8)
                    .addComponent(jLabel29))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jLabel8)
                .addGap(16, 16, 16)
                .addComponent(jLabel12)
                .addGap(16, 16, 16)
                .addComponent(jLabel16)
                .addGap(16, 16, 16)
                .addComponent(jLabel17)
                .addGap(16, 16, 16)
                .addComponent(jLabel18)
                .addGap(16, 16, 16)
                .addComponent(jLabel19)
                .addGap(16, 16, 16)
                .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16)
                .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(43, Short.MAX_VALUE))
        );

        jPCalendario.setName("jPCalendario"); // NOI18N

        javax.swing.GroupLayout jPCalendarioLayout = new javax.swing.GroupLayout(jPCalendario);
        jPCalendario.setLayout(jPCalendarioLayout);
        jPCalendarioLayout.setHorizontalGroup(
            jPCalendarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 683, Short.MAX_VALUE)
        );
        jPCalendarioLayout.setVerticalGroup(
            jPCalendarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 507, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPCalendario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPCalendario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jSPCalendario.setViewportView(jPanel1);

        jPanel5.setName("jPanel5"); // NOI18N

        jLabel31.setFont(resourceMap.getFont("jLabel34.font")); // NOI18N
        jLabel31.setText(resourceMap.getString("jLabel31.text")); // NOI18N
        jLabel31.setName("jLabel31"); // NOI18N

        jLabel30.setFont(resourceMap.getFont("jLabel34.font")); // NOI18N
        jLabel30.setText(resourceMap.getString("jLabel30.text")); // NOI18N
        jLabel30.setName("jLabel30"); // NOI18N

        jLabel32.setFont(resourceMap.getFont("jLabel34.font")); // NOI18N
        jLabel32.setText(resourceMap.getString("jLabel32.text")); // NOI18N
        jLabel32.setName("jLabel32"); // NOI18N

        jLabel33.setFont(resourceMap.getFont("jLabel34.font")); // NOI18N
        jLabel33.setText(resourceMap.getString("jLabel33.text")); // NOI18N
        jLabel33.setName("jLabel33"); // NOI18N

        jLabel34.setFont(resourceMap.getFont("jLabel34.font")); // NOI18N
        jLabel34.setText(resourceMap.getString("jLabel34.text")); // NOI18N
        jLabel34.setName("jLabel34"); // NOI18N

        jLabel35.setFont(resourceMap.getFont("jLabel34.font")); // NOI18N
        jLabel35.setText(resourceMap.getString("jLabel35.text")); // NOI18N
        jLabel35.setName("jLabel35"); // NOI18N

        jLabel36.setFont(resourceMap.getFont("jLabel34.font")); // NOI18N
        jLabel36.setText(resourceMap.getString("jLabel36.text")); // NOI18N
        jLabel36.setName("jLabel36"); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addGap(64, 64, 64)
                .addComponent(jLabel30)
                .addGap(58, 58, 58)
                .addComponent(jLabel31)
                .addGap(57, 57, 57)
                .addComponent(jLabel32)
                .addGap(51, 51, 51)
                .addComponent(jLabel33)
                .addGap(61, 61, 61)
                .addComponent(jLabel34)
                .addGap(57, 57, 57)
                .addComponent(jLabel36)
                .addGap(56, 56, 56)
                .addComponent(jLabel35)
                .addGap(77, 77, 77))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel31)
                    .addComponent(jLabel34)
                    .addComponent(jLabel33)
                    .addComponent(jLabel36)
                    .addComponent(jLabel35)
                    .addComponent(jLabel30)
                    .addComponent(jLabel32)))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jSPCalendario, javax.swing.GroupLayout.PREFERRED_SIZE, 759, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(844, 844, 844)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(jLabel7))
                        .addGap(685, 685, 685)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel4)))
                    .addComponent(jLabel6))
                .addGap(48, 48, 48)
                .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, 782, Short.MAX_VALUE)
                .addGap(1642, 1642, 1642))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(5, 5, 5)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSPCalendario, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(46, 46, 46)
                        .addComponent(jLabel1)
                        .addGap(34, 34, 34)
                        .addComponent(jLabel3)
                        .addGap(134, 134, 134)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel4)
                                        .addGap(26, 26, 26)
                                        .addComponent(jLabel5)
                                        .addGap(26, 26, 26)
                                        .addComponent(jLabel6)
                                        .addGap(205, 205, 205))
                                    .addComponent(jLabel7))
                                .addGap(35, 35, 35))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton3)))))
                .addGap(8, 8, 8))
        );

        bindingGroup.bind();

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-800)/2, (screenSize.height-600)/2, 800, 600);
    }// </editor-fold>//GEN-END:initComponents

private void jComboBoxPrestacionItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBoxPrestacionItemStateChanged
//comobo prestacion
    
    EntityManager em = getEntityManager();
    Practica prac = (Practica) jComboBoxPrestacion.getSelectedItem();
    if(jComboBoxPrestacion.getSelectedIndex()!=-1){
    Query query = em.createNamedQuery("Practicaxempleado.findByIdPractica");
    query.setParameter("idPractica", prac.getIdPractica());
    practicaxempleadoList.clear();
    practicaxempleadoList.addAll(query.getResultList());
    //jComboBoxProfesional.setSelectedIndex(1);
    jComboBoxProfesional.updateUI();
    jComboBoxProfesional.repaint();
    em.close();
    diaatencion.clear();
    turnos.clear();
    CargarCalendario();
    jComboBoxProfesional.setSelectedItem("");
    jComboBoxProfesional.setSelectedIndex(-1);
    jComboBoxDuracion.setSelectedIndex(-1);
    jComboBoxHorarioTurno.setSelectedIndex(-1);
    }
   
}//GEN-LAST:event_jComboBoxPrestacionItemStateChanged

private void jComboBoxProfesionalItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBoxProfesionalItemStateChanged
// combo profesional
    //evento();

}//GEN-LAST:event_jComboBoxProfesionalItemStateChanged

private void evento()
{
    jLabel37.setVisible(false);
    if(jComboBoxPrestacion.getSelectedIndex()!=-1 && jComboBoxProfesional.getSelectedIndex()!=-1 ){
    filtroTurnoSemana();
    if(!sobreturno){

    EntityManager em = getEntityManager();
    Empleado emp = ((Practicaxempleado) jComboBoxProfesional.getSelectedItem()).getEmpleado();
    Query query = em.createQuery("SELECT e FROM Diaatencion e WHERE e.idEmpleado=:idEmpleado");
    query.setParameter("idEmpleado", emp);
    diaatencion.clear();
    diaatencion.addAll(query.getResultList());
    query = em.createQuery("SELECT t FROM Turno t WHERE t.practicaxempleado.empleado=:param and t.hora between :min and :max");
    // query = em.createQuery("SELECT t FROM Turno t WHERE t.practicaxempleado.empleado=:param and t.hora>=min and t.hora<=max");
    query.setParameter("param", ((Practicaxempleado) jComboBoxProfesional.getSelectedItem()).getEmpleado());
    query.setParameter("min", min);
    query.setParameter("max", max);
    turnos.clear();
    turnos.addAll(query.getResultList());
    em.close();
    jComboBoxHorarioTurno.removeAllItems();
    initComboHora();
    filtrodias();

    if(this.isShowing()){
        calendario.pintarBardo(turnos, diaatencion);
        calendario.updateUI();
        calendario.repaint();
       
    }
   }
    else
    {
    EntityManager em = getEntityManager();
    Empleado emp = ((Practicaxempleado) jComboBoxProfesional.getSelectedItem()).getEmpleado();
    Query query = em.createQuery("SELECT e FROM Diaatencion e");
    diaatencion.clear();
    diaatencion.addAll(query.getResultList());
    query = em.createQuery("SELECT t FROM Turno t WHERE t.hora between :min and :max");
    query.setParameter("min", min);
    query.setParameter("max", max);
    turnos.clear();
    turnos.addAll(query.getResultList());
    em.close();
    jComboBoxHorarioTurno.removeAllItems();
    initComboHora();
    jComboBoxHorarioTurno.updateUI();
    jComboBoxHorarioTurno.repaint();

    }

        if (jComboBoxHorarioTurno.getItemCount()<2 || empleadoList.isEmpty()) {
            jComboBoxHorarioTurno.setEnabled(false);
            jComboBoxDuracion.setEnabled(false);
            jLabel37.setVisible(true);
        } else {
            jComboBoxHorarioTurno.setEnabled(true);
            jComboBoxHorarioTurno.setSelectedIndex(-1);
            jComboBoxDuracion.setEnabled(true);
            jComboBoxDuracion.setSelectedIndex(-1);
        }


   }
    
}

private void jTextFieldPacienteKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldPacienteKeyReleased
    try {
        int doc = Integer.parseInt(jTextFieldPaciente.getText());
        pacienteQuery = PodologiaPUEntityManager.createNativeQuery("SELECT * FROM Paciente p, Persona pe WHERE p.idPaciente=pe.idpersona and pe.nroDoc like '" + jTextFieldPaciente.getText() + "%'", podologia.beansDB.Paciente.class);
    } catch (NumberFormatException ex) {
        pacienteQuery = PodologiaPUEntityManager.createQuery("SELECT p FROM Paciente p WHERE p.idPersona.nombre like '" + jTextFieldPaciente.getText() + "%' or p.idPersona.apellido like '" + jTextFieldPaciente.getText() + "%'");
    }
    pacienteQuery.setMaxResults(20);
    pacienteList.clear();
    pacienteList.addAll(pacienteQuery.getResultList());
    jTablePaciente.updateUI();
    jTablePaciente.repaint();
    
}//GEN-LAST:event_jTextFieldPacienteKeyReleased

private void jButtonReservarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonReservarActionPerformed

    if(jComboBoxPrestacion.getSelectedIndex()!=-1 && jComboBoxProfesional.getSelectedIndex()!=-1 && jComboBoxHorarioTurno.getSelectedIndex()!=-1 &&
       jComboBoxDuracion.getSelectedIndex()!=-1 && !jTextFieldPaciente.getText().equals(""))
    {
    //Creacion y seteo de los atributos que forman el turno.
    Practicaxempleado pxe= (Practicaxempleado) jComboBoxProfesional.getSelectedItem(); //  int legajo;int idPractica;
    Paciente paciente = (Paciente)pacienteList.get(jTablePaciente.getSelectedRow());
       
    long hora=((InfoHora)jComboBoxHorarioTurno.getSelectedItem()).getHora();
    long duracion=((InfoHora)jComboBoxDuracion.getSelectedItem()).getHora();
    int asistencia;
    Lugaratencion idLugarAtencion= new Lugaratencion();
    
//Suma a la hora del combo, la hora del dia seleccionado en 00:00
    Calendar diaTurno = Calendar.getInstance();
    diaTurno.setTime(jCalendar1.getDate());
    Calendar auxD = Calendar.getInstance();
    auxD.set(diaTurno.get(diaTurno.YEAR), diaTurno.get(diaTurno.MONTH), diaTurno.get(diaTurno.DAY_OF_MONTH), 0, 0);
    hora+=auxD.getTimeInMillis();
    
//Busca el Lugar de Atención
    if (jComboBoxLugar.getSelectedIndex() == 0) {
        idLugarAtencion.setIdLugar(1);
    } else {
        idLugarAtencion.setIdLugar(2);}
      
//Seteo del turno que se desea reservar.
    Turno turno=new Turno();
    turno.setPracticaxempleado(pxe);
    turno.setIdPaciente(paciente);
    turno.setDuracion(duracion);
    turno.setHora(hora);
    turno.setIdLugarAte(idLugarAtencion);
    turno.setAsistencia(0);
    
    //Persistencia del objeto.
    EntityManager em = getEntityManager();
    em.getTransaction().begin();
    em.persist(turno);
    em.getTransaction().commit();
    JOptionPane.showMessageDialog(null, "Turno Reservado" );
    em.close();
    turnos.add(turno);

    CargarCalendario();

    jComboBoxPrestacion.setSelectedIndex(-1);
    jComboBoxProfesional.setSelectedIndex(-1);
    jComboBoxDuracion.setSelectedIndex(-1);
    jComboBoxHorarioTurno.setSelectedIndex(-1);
    }
    else
    {
         JOptionPane.showMessageDialog(null, "Faltan Datos para Reservar Turno");
    }
    
}//GEN-LAST:event_jButtonReservarActionPerformed

private void jCalendar1PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jCalendar1PropertyChange

}//GEN-LAST:event_jCalendar1PropertyChange

private void jCalendar1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jCalendar1MouseClicked

}//GEN-LAST:event_jCalendar1MouseClicked

private void jCalendar1DateChanged(org.freixas.jcalendar.DateEvent evt) {//GEN-FIRST:event_jCalendar1DateChanged
evento();
}//GEN-LAST:event_jCalendar1DateChanged

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
//Abre ventana Listado de turnos por profesional
    
    ListarTurnosProfesional t = new ListarTurnosProfesional();
    this.getParent().add(t);
    t.setVisible(true);
    dispose();
}//GEN-LAST:event_jButton1ActionPerformed

private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed

    if (jToggleButton1.isSelected())
        sobreturno=true;
    else
        sobreturno=false;
}//GEN-LAST:event_jToggleButton1ActionPerformed

private void jTablePacienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTablePacienteMouseClicked
jTextFieldPaciente.setText(pacienteList.get(jTablePaciente.getSelectedRow()).getNombreCompleto());
}//GEN-LAST:event_jTablePacienteMouseClicked

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
 NuevoPaciente nvopaciente=new NuevoPaciente();
           this.getParent().add(nvopaciente);
           nvopaciente.setVisible(true);
           dispose();// TODO add your handling code here:
}//GEN-LAST:event_jButton2ActionPerformed

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
Rep r=new Rep("C:\\Users\\Public\\Reportes\\ComprobantedeTurno.jasper");
}//GEN-LAST:event_jButton4ActionPerformed

private void jComboBoxProfesionalPopupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_jComboBoxProfesionalPopupMenuWillBecomeInvisible
evento();    // TODO add your handling code here:
}//GEN-LAST:event_jComboBoxProfesionalPopupMenuWillBecomeInvisible

    private void initVectorIndices() {
        //inicializacion vector de indices para el remove de item de jComboBox3 horarios
        for (int i = 0; i < 60; i++) {
            indices[i] = 0;
        }

    }

    private void deletIndices() {

        for (int i = 60; i > -1; i--) {
            if (indices[i] == 1) {
                jComboBoxHorarioTurno.removeItemAt(i);
            }
        }
    }

    private void filtrodias() {
        Calendar diaselected = Calendar.getInstance();
        diaselected.setTime(jCalendar1.getDate());

        //inicializacion vector de indices para el remove de item de jComboBox3 horarios   
        initVectorIndices();
        // Filtro de Horario de Atencion por profesional seleccionado 
        InfoHora ih = new InfoHora();
        Long horafinAnt = 0L;
        Long horainicioAtencion = 0L;
        Long horacombo = 0L;

        for (Diaatencion dlist : diaatencion) {
            if (dlist.getDia() == diaselected.get(Calendar.DAY_OF_WEEK)) {

                for (int i = 0; i < jComboBoxHorarioTurno.getItemCount(); i++) {
                    ih = (InfoHora) jComboBoxHorarioTurno.getItemAt(i);
                    horainicioAtencion = dlist.getHoraInicio();
                    horacombo = ih.getHora();
                    if (horainicioAtencion > horacombo && horafinAnt < horacombo) {
                        indices[i] = 1;

                    }
                }
                //Guarda la HoraFin del ultimo registro de atencion del dia.
                horafinAnt = dlist.getHoraFin();
            }
        }
        //Borra los indices marcados en el vector
        deletIndices();

        //Borra los indices de Horarios mayores al ultimo horario de atencion
        initVectorIndices();
        for (int i = 0; i < jComboBoxHorarioTurno.getItemCount(); i++) {
            ih = (InfoHora) jComboBoxHorarioTurno.getItemAt(i);
            if (ih.getHora() > horafinAnt) {
                indices[i] = 1;
            }
        }
        deletIndices();

        // Filtro de Turnos del profesional seleccionado
        // diaselected => DIA SELECCIONADO DESDE EL COMPONENTE CALENDAR
        // diaTurno=> SE SETEA CON LA HORA DE CADA INSTANCIA DE LA LISTA DE TURNOS FILTRADOS

        long horaturnoinicio = 0L;
        long horaturnofin = 0L;
        Calendar diaTurno = Calendar.getInstance();
        Calendar auxD = Calendar.getInstance();

        for (Turno tlist : turnos) {
            diaTurno.setTimeInMillis(tlist.getHora());

            if (diaTurno.get(Calendar.DAY_OF_YEAR) == diaselected.get(Calendar.DAY_OF_YEAR) && diaTurno.get(Calendar.YEAR) == diaselected.get(Calendar.YEAR)) {
                auxD = diaselected;
                auxD.set(diaTurno.get(diaTurno.YEAR), diaTurno.get(diaTurno.MONTH), diaTurno.get(diaTurno.DAY_OF_MONTH), 0, 0);
                horaturnoinicio = diaTurno.getTimeInMillis() - auxD.getTimeInMillis();
                horaturnofin = horaturnoinicio + tlist.getDuracion();
                for (int i = 0; i < jComboBoxHorarioTurno.getItemCount(); i++) {
                    if (horaturnoinicio == ((InfoHora) jComboBoxHorarioTurno.getItemAt(i)).getHora()) {
                        while (horaturnofin > ((InfoHora) jComboBoxHorarioTurno.getItemAt(i)).getHora()) {
                            jComboBoxHorarioTurno.remove(i);
                            i++;
                        }
                    }
                }
            }


        }


    }

    private void initComboHora () { 
    
    for (int i=0;i<60;i++) hora[i]=new InfoHora();
    for (int i=0;i<12;i++) duracion[i]=new InfoHora();
    for (int i=0;i<60;i++){
        dur[i]=(i*900000)+25200000;
       //System.out.println(dur[i]);
    }
    
     hora[0].setTexthora("07:00");
     hora[0].setHora(dur[0]);
     jComboBoxHorarioTurno.addItem(hora[0]);
     hora[1].setTexthora("07:15");
     hora[1].setHora(dur[1]);
     jComboBoxHorarioTurno.addItem(hora[1]);
     hora[2].setTexthora("07:30");
     hora[2].setHora(dur[2]);
     jComboBoxHorarioTurno.addItem(hora[2]);
     hora[3].setTexthora("07:45");
     hora[3].setHora(dur[3]);
     jComboBoxHorarioTurno.addItem(hora[3]);
     hora[4].setTexthora("08:00");
     hora[4].setHora(dur[4]);
     jComboBoxHorarioTurno.addItem(hora[4]);
     hora[5].setTexthora("08:15");
     hora[5].setHora(dur[5]);
     jComboBoxHorarioTurno.addItem(hora[5]);
     hora[6].setTexthora("08:30");
     hora[6].setHora(dur[6]);
     jComboBoxHorarioTurno.addItem(hora[6]);
     hora[7].setTexthora("08:45");
     hora[7].setHora(dur[7]);
     jComboBoxHorarioTurno.addItem(hora[7]);
     hora[8].setTexthora("09:00");
     hora[8].setHora(dur[8]);
     jComboBoxHorarioTurno.addItem(hora[8]);
     hora[9].setTexthora("09:15");
     hora[9].setHora(dur[9]);
     jComboBoxHorarioTurno.addItem(hora[9]);
     hora[10].setTexthora("09:30");
     hora[10].setHora(dur[10]);
     jComboBoxHorarioTurno.addItem(hora[10]);
     hora[11].setTexthora("09:45");
     hora[11].setHora(dur[11]);
     jComboBoxHorarioTurno.addItem(hora[11]);
     hora[12].setTexthora("10:00");
     hora[12].setHora(dur[12]);
     jComboBoxHorarioTurno.addItem(hora[12]);
     hora[13].setTexthora("10:15");
     hora[13].setHora(dur[13]);
     jComboBoxHorarioTurno.addItem(hora[13]);
     hora[14].setTexthora("10:30");
     hora[14].setHora(dur[14]);
     jComboBoxHorarioTurno.addItem(hora[14]);
     hora[15].setTexthora("10:45");
     hora[15].setHora(dur[15]);
     jComboBoxHorarioTurno.addItem(hora[15]);
     hora[16].setTexthora("11:00");
     hora[16].setHora(dur[16]);
     jComboBoxHorarioTurno.addItem(hora[16]);
     hora[17].setTexthora("11:15");
     hora[17].setHora(dur[17]);
     jComboBoxHorarioTurno.addItem(hora[17]);
     hora[18].setTexthora("11:30");
     hora[18].setHora(dur[18]);
     jComboBoxHorarioTurno.addItem(hora[18]);
     hora[19].setTexthora("11:45");
     hora[19].setHora(dur[19]);
     jComboBoxHorarioTurno.addItem(hora[19]);
     hora[20].setTexthora("12:00");
     hora[20].setHora(dur[20]);
     jComboBoxHorarioTurno.addItem(hora[20]);
     hora[21].setTexthora("12:15");
     hora[21].setHora(dur[21]);
     jComboBoxHorarioTurno.addItem(hora[21]);
     hora[22].setTexthora("12:30");
     hora[22].setHora(dur[22]);
     jComboBoxHorarioTurno.addItem(hora[22]);
     hora[23].setTexthora("12:45");
     hora[23].setHora(dur[23]);
     jComboBoxHorarioTurno.addItem(hora[23]);
     hora[24].setTexthora("13:00");
     hora[24].setHora(dur[24]);
     jComboBoxHorarioTurno.addItem(hora[24]);
     hora[25].setTexthora("13:15");
     hora[25].setHora(dur[25]);
     jComboBoxHorarioTurno.addItem(hora[25]);
     hora[26].setTexthora("13:30");
     hora[26].setHora(dur[26]);
     jComboBoxHorarioTurno.addItem(hora[26]);
     hora[27].setTexthora("13:45");
     hora[27].setHora(dur[27]);
     jComboBoxHorarioTurno.addItem(hora[27]);
     hora[28].setTexthora("14:00");
     hora[28].setHora(dur[28]);
     jComboBoxHorarioTurno.addItem(hora[28]);
     hora[29].setTexthora("14:15");
     hora[29].setHora(dur[29]);
     jComboBoxHorarioTurno.addItem(hora[29]);
     hora[30].setTexthora("14:30");
     hora[30].setHora(dur[30]);
     jComboBoxHorarioTurno.addItem(hora[30]);
     hora[31].setTexthora("14:45");
     hora[31].setHora(dur[31]);
     jComboBoxHorarioTurno.addItem(hora[31]);
     hora[32].setTexthora("15:00");
     hora[32].setHora(dur[32]);
     jComboBoxHorarioTurno.addItem(hora[32]);
     hora[33].setTexthora("15:15");
     hora[33].setHora(dur[33]);
     jComboBoxHorarioTurno.addItem(hora[33]);
     hora[34].setTexthora("15:30");
     hora[34].setHora(dur[34]);
     jComboBoxHorarioTurno.addItem(hora[34]);
     hora[35].setTexthora("15:45");
     hora[35].setHora(dur[35]);
     jComboBoxHorarioTurno.addItem(hora[35]);
     hora[36].setTexthora("16:00");
     hora[36].setHora(dur[36]);
     jComboBoxHorarioTurno.addItem(hora[36]);
     hora[37].setTexthora("16:15");
     hora[37].setHora(dur[37]);
     jComboBoxHorarioTurno.addItem(hora[37]);
     hora[38].setTexthora("16:30");
     hora[38].setHora(dur[38]);
     jComboBoxHorarioTurno.addItem(hora[38]);
     hora[39].setTexthora("16:45");
     hora[39].setHora(dur[39]);
     jComboBoxHorarioTurno.addItem(hora[39]);
     hora[40].setTexthora("17:00");
     hora[40].setHora(dur[40]);
     jComboBoxHorarioTurno.addItem(hora[40]);
     hora[41].setTexthora("17:15");
     hora[41].setHora(dur[41]);
     jComboBoxHorarioTurno.addItem(hora[41]);
     hora[42].setTexthora("17:30");
     hora[42].setHora(dur[42]);
     jComboBoxHorarioTurno.addItem(hora[42]);
     hora[43].setTexthora("17:45");
     hora[43].setHora(dur[43]);
     jComboBoxHorarioTurno.addItem(hora[43]);
     hora[44].setTexthora("18:00");
     hora[44].setHora(dur[44]);
     jComboBoxHorarioTurno.addItem(hora[44]);
     hora[45].setTexthora("18:15");
     hora[45].setHora(dur[45]);
     jComboBoxHorarioTurno.addItem(hora[45]);
     hora[46].setTexthora("18:30");
     hora[46].setHora(dur[46]);
     jComboBoxHorarioTurno.addItem(hora[46]);
     hora[47].setTexthora("18:45");
     hora[47].setHora(dur[47]);
     jComboBoxHorarioTurno.addItem(hora[47]);
     hora[48].setTexthora("19:00");
     hora[48].setHora(dur[48]);
     jComboBoxHorarioTurno.addItem(hora[48]);
     hora[49].setTexthora("19:15");
     hora[49].setHora(dur[49]);
     jComboBoxHorarioTurno.addItem(hora[49]);
     hora[50].setTexthora("19:30");
     hora[50].setHora(dur[50]);
     jComboBoxHorarioTurno.addItem(hora[50]);
     hora[51].setTexthora("19:45");
     hora[51].setHora(dur[51]);
     jComboBoxHorarioTurno.addItem(hora[51]);
     hora[52].setTexthora("20:00");
     hora[52].setHora(dur[52]);
     jComboBoxHorarioTurno.addItem(hora[52]);
     hora[53].setTexthora("20:15");
     hora[53].setHora(dur[53]);
     jComboBoxHorarioTurno.addItem(hora[53]);
     hora[54].setTexthora("20:30");
     hora[54].setHora(dur[54]);
     jComboBoxHorarioTurno.addItem(hora[54]);
     hora[55].setTexthora("20:45");
     hora[55].setHora(dur[55]);
     jComboBoxHorarioTurno.addItem(hora[55]);
     hora[56].setTexthora("21:00");
     hora[56].setHora(dur[56]);
     jComboBoxHorarioTurno.addItem(hora[56]);
     hora[57].setTexthora("21:15");
     hora[57].setHora(dur[57]);
     jComboBoxHorarioTurno.addItem(hora[57]);
     hora[58].setTexthora("21:30");
     hora[58].setHora(dur[58]);
     jComboBoxHorarioTurno.addItem(hora[58]);
     hora[59].setTexthora("21:45");
     hora[59].setHora(dur[59]);
     jComboBoxHorarioTurno.addItem(hora[59]);
     
     
     for (int i=0;i<60;i++){
        dur[i]=((i+1)*900000);
     }
     
     duracion[0].setTexthora("00:15");
     duracion[0].setHora(dur[0]);
     jComboBoxDuracion.addItem(duracion[0]);
     duracion[1].setTexthora("00:30");
     duracion[1].setHora(dur[1]);
     jComboBoxDuracion.addItem(duracion[1]);
     duracion[2].setTexthora("00:45");
     duracion[2].setHora(dur[2]);
     jComboBoxDuracion.addItem(duracion[2]);
     duracion[3].setTexthora("01:00");
     duracion[3].setHora(dur[3]);
     jComboBoxDuracion.addItem(duracion[3]);
     duracion[4].setTexthora("01:15");
     duracion[4].setHora(dur[4]);
     jComboBoxDuracion.addItem(duracion[4]);
     duracion[5].setTexthora("01:30");
     duracion[5].setHora(dur[5]);
     jComboBoxDuracion.addItem(duracion[5]);
     duracion[6].setTexthora("01:45");
     duracion[6].setHora(dur[6]);
     jComboBoxDuracion.addItem(duracion[6]);
     duracion[7].setTexthora("02:00");
     duracion[7].setHora(dur[7]);
     jComboBoxDuracion.addItem(duracion[7]);
     duracion[8].setTexthora("02:15");
     duracion[8].setHora(dur[8]);
     jComboBoxDuracion.addItem(duracion[8]);
     duracion[9].setTexthora("02:30");
     duracion[9].setHora(dur[9]);
     jComboBoxDuracion.addItem(duracion[9]);
     duracion[10].setTexthora("02:45");
     duracion[10].setHora(dur[10]);
     jComboBoxDuracion.addItem(duracion[10]);
     duracion[11].setTexthora("03:00");
     duracion[11].setHora(dur[11]);
     jComboBoxDuracion.addItem(duracion[11]);
     
}

    private void filtroTurnoSemana(){
        Calendar diaselected= Calendar.getInstance();
        diaselected.setTime(jCalendar1.getDate());
        diaselected.set(Calendar.HOUR_OF_DAY, 1);       
        diaselected.set(Calendar.MINUTE, 0);        
        diaselected.set(Calendar.SECOND, 0);        

        int diasem= diaselected.get(Calendar.DAY_OF_WEEK);
        max = diaselected.getTime().getTime();
        min = diaselected.getTime().getTime();
        //Resta y suma los miliseg de un dia de Lunes a Domingo
        if(diasem==1){diasem=8;}
        for(int i=diasem; i>2; i--){
            min-=86400000;

        }
        for(int i=diasem; i<9; i++){
            max+=86400000;
        }

    }
    
    




    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.persistence.EntityManager PodologiaPUEntityManager;
    private java.util.List<podologia.beansDB.Empleado> empleadoList;
    private javax.persistence.Query empleadoQuery;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButtonReservar;
    private org.freixas.jcalendar.JCalendar jCalendar1;
    private javax.swing.JComboBox jComboBoxDuracion;
    private javax.swing.JComboBox jComboBoxHorarioTurno;
    private javax.swing.JComboBox jComboBoxLugar;
    private javax.swing.JComboBox jComboBoxPrestacion;
    private javax.swing.JComboBox jComboBoxProfesional;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPCalendario;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jSPCalendario;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTablePaciente;
    private javax.swing.JTextField jTextFieldPaciente;
    private javax.swing.JToggleButton jToggleButton1;
    private java.util.List<podologia.beansDB.Paciente> pacienteList;
    private java.util.List<podologia.beansDB.Paciente> pacienteList1;
    private javax.persistence.Query pacienteQuery;
    private javax.persistence.Query pacienteQuery1;
    private java.util.List<podologia.beansDB.Practica> practicaList;
    private javax.persistence.Query practicaQuery;
    private java.util.List<podologia.beansDB.Practicaxempleado> practicaxempleadoList;
    private javax.persistence.Query practicaxempleadoQuery;
    private javax.persistence.Query turnosQuery;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables

}
